import time
from concurrent.futures import ProcessPoolExecutor, wait, ALL_COMPLETED



def excutor(t):
    time.sleep(t)
    print('this is %s' % t)
    return t


if __name__ == '__main__':

    ppe = ProcessPoolExecutor(max_workers=5)
    urls=[1,2,3,4,5]
    alltask=[ppe.submit(excutor,u) for u in urls]
    wait(alltask,return_when=ALL_COMPLETED)
    print('all finished')
